require 'spec'

require File.dirname(__FILE__) + '/../lib/g_translate.rb'

def has_internet
  require 'open-uri'
  proceed = 
    begin
      open( 'http://google.com/translate_t' ) do |page| 
        page.read =~ /google/i ? true : false
      end
    rescue
      false
    end
  yield if proceed
end
